﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Reflection;
using System.Data;
using System.IO;
using System.Configuration;
using System.Text;
using System.Security.Cryptography;

/// <summary>
/// Summary description for Security
/// </summary>

    public class Security
    {

        public Security()
        {
        }

        public static string CipherCode(string SecretPass)
        {
            string strReturn = string.Empty;
            byte[] ByteSourceText = ASCIIEncoding.ASCII.GetBytes(SecretPass);

            MD5CryptoServiceProvider Md5Hash = new MD5CryptoServiceProvider();
            byte[] ByteHash = Md5Hash.ComputeHash(ByteSourceText);

            foreach (byte b in ByteHash)
                strReturn = strReturn + b.ToString("x2");

            return strReturn.ToString();
        }

    }
